﻿@model WebUI.Models.QizSmsSubject
@if (null == Model)
{ 
    <span>请先选择短信随访定义</span>
}
else
{
    <table class="width noborder toolbox">
        <tr>
            <td>
                <div class="icons icons-ok">
                    @Html.DisplayFor(m=> Model.Title)
                </div>
                <div class="icons">
                    @Ajax.ActionLink("[修改/查看]", "SmsQuizEdit", new { ID = Model.ID, utid = "treeview" }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "dialogbox", OnComplete = "showDialog('短信随访单');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
                </div>
                <div class="icons icons-del">
                    @Ajax.ActionLink("[删除]", "SmsQuizDel", new { ID = Model.ID, utid = "treeview" }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "treeview", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError", Confirm = OnConfirmDel() })
                </div>
            </td>
            <td align="right">
                @if (null != Model)
                {
                    <div class="icons icons-add">
                        @Ajax.ActionLink("新建阶段并导入指标", "SmsQuizMonthIdxEdit", new { SmsSubjectID = Model.ID, utid = "listview" }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "dialogbox", OnComplete = "showDialog('随访单明细');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
                    </div>
                }
            </td>
        </tr>
    </table>

    <table class="width">
        <tr>
            <th>
                阶段
            </th>
            <th>
                指标
            </th>
            <th>
                类型
            </th>
            <th>
                顺序
            </th>
            <th></th>
        </tr>
        @{var lstmon = "出院";}
        @foreach (var monthidx in Model.QizSmsSubjectMonthIdxes.OrderBy(v => v.MonthIdx))
        {
            <tr>
                <td colspan="4"><strong> @lstmon 至  @Html.DisplayFor(modelItem => monthidx.MonthIdx) 个月&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第@(monthidx.SmsSendingMonthIdx)个月，第@(monthidx.SmsSendingDayIdx)天发送短信</strong></td>
                @{lstmon =(monthidx.MonthIdx+1).ToString();}

                <td>@Ajax.ActionLink("催报", "QizSessionReminding", new { ID = monthidx.ID, utid = "listview" }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnComplete = "showDialog('随访单明细');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError", Confirm = "" }) |
                @Ajax.ActionLink("编辑", "SmsQuizMonthIdxEdit", new { ID = monthidx.ID, utid = "listview" }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnComplete = "showDialog('随访单明细');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" }) |
                @Ajax.ActionLink("删除", "SmsQuizMonthIdxDel", new { ID = monthidx.ID, utid = "listview" }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "listview", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError", Confirm = OnConfirmDel() }) 
                </td>
            </tr>
            foreach (var item in monthidx.QizSmsSubjDefines.OrderBy(v=>v.QizSubjectDefine.SortIdx))
            {
            <tr>
                <td>
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.QizSubjectDefine.QizItem.Title)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.QizSubjectDefine.QizItem.TypeRef.OptionTitle)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.QizSubjectDefine.SortIdx)
                </td>
                <td>
                    @Ajax.ActionLink("删除", "SmsQuizDefineDel", new { ID = item.ID, utid = "listview" }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "listview", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, Confirm = OnConfirmDel() })
                </td>
            </tr>
            }
        }
    </table>
}